﻿using CardMonitor.Pages;
using CardMonitor.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CardMonitor.Windows
{
    /// <summary>
    /// SettingWindow.xaml 的交互逻辑
    /// </summary>
    public partial class SettingWindow : Window
    {
        public SettingWindow()
        {
            InitializeComponent();
        }

        private void btn_Click_CloseSystem(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btn_Click_CardOperator(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;
            string oper = (string)button.Content;
            switch (oper)
            {
                case "移动卡片至读卡位置":
                    CardDeviceUtil.MoveCardToReadPosition();
                    break;
                case "允许前端制卡":
                    CardDeviceUtil.EndableFrontInCard();
                    break;
                case "禁止前端制卡":
                    CardDeviceUtil.DisableFrontInCard();
                    break;
                case "弹出卡片":
                    CardDeviceUtil.PopupCard();
                    break;
                case "回收卡片":
                    CardDeviceUtil.ReceiveCard();
                    break;
             
            }
        }


    }
}
